#include <stdio.h>

int removeDuplicates(int *nums, int numsSize)
{
    int fast =1;
    int slow = 1;
    while(fast<numsSize)
    {
        if(nums[fast]!= nums[fast-1])
        {
            nums[slow]=nums[fast];
            slow++;
        }
        fast++;
    }
    return slow;
}

int main()
{
    int nums[] = {0,0,1,1,1,2,2,3,3,4};
    int len = sizeof(nums) / sizeof(nums[0]);
    int ret = removeDuplicates(nums, len);
    printf("%d\n", ret);
    for (int i = 0; i < ret; i++)
    {
        printf("%d ", nums[i]);
    }
    printf("\n");
    return 0;
}
